package com.pfa.test.entities;

import java.util.Collection;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;

@Entity
public class Materiel {
	@Id
	private String reference;
	private String typeMateriel;
	
	@OneToMany(mappedBy="materiel")
	private Collection<DemandeReparation> reparations;

	@ManyToMany(fetch = FetchType.EAGER, mappedBy = "materiels")
	private Collection<Panne> pannes;
	public Materiel() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Materiel(String reference, String typeMateriel) {
		super();
		this.reference = reference;
		this.typeMateriel = typeMateriel;
	}
	public String getReference() {
		return reference;
	}
	public void setReference(String reference) {
		this.reference = reference;
	}
	public String getTypeMateriel() {
		return typeMateriel;
	}
	public void setTypeMateriel(String typeMateriel) {
		this.typeMateriel = typeMateriel;
	}
	public Collection<DemandeReparation> getReparations() {
		return reparations;
	}
	public void setReparations(Collection<DemandeReparation> reparations) {
		this.reparations = reparations;
	}
	public Collection<Panne> getPannes() {
		return pannes;
	}
	public void setPannes(Collection<Panne> pannes) {
		this.pannes = pannes;
	}
	
	
}
